import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
// 引入登录组件
import login from '@/views/login.vue'
//引入注册组件
import home from '@/views/home.vue'
import index from '@/views/nav/index.vue';
import profile from '@/views/nav/profile.vue';

import user from '@/views/nav/user.vue'
import tiku from '@/views/nav/tiku.vue'
import Carousel from'@/views/nav/Carousel.vue'

const routes = [
  {
    path: '/',//路由地址
    name: 'login',
    component: login//相对应的组件
  },
  //首页
  {
    path: '/home',//路由地址
    name: 'home',
    component: home,//相对应的组件
    redirect: { name: "index" },
    children: [
      {
        path: '/index',
        name: 'index',
        component: index,
      },
       {
        path: '/profile',
        name: 'profile',
        component: profile,
      },
      {
       path: '/user',
       name: 'user',
       component: user,
     },
     {
      path: '/tiku',
      name: 'tiku',
      component: tiku,
    },
    {
     path: '/Carousel',
     name: 'Carousel',
     component: Carousel,
   }

    ]
  },

]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
});


export default router
